package com.tanhua.common.utils;

import com.tanhua.common.pojo.BsUser;

public class BsUserThreadLocal {

    private static final ThreadLocal<BsUser> LOCAL = new ThreadLocal<>();

    private BsUserThreadLocal(){

    }

    /**
     * 将对象放入到ThreadLocal
     *
     * @param bsUser
     */
    public static void set(BsUser bsUser){
        LOCAL.set(bsUser);
    }

    /**
     * 返回当前线程中的User对象
     *
     * @return
     */
    public static BsUser get(){
        return LOCAL.get();
    }

    /**
     * 删除当前线程中的User对象
     */
    public static void remove(){
        LOCAL.remove();
    }

}
